# -*- coding: utf-8 -*-
# @File : .py
# @Author : ZhouHang
# @Date : 20-4-8
# @Desc :
from celery import Celery


import os

# 给celery添加django配置文件
if not os.getenv('DJANGO_SETTINGS_MODULE'):
    os.environ['DJANGO_SETTINGS_MODULE'] = 'meiduo.settings.dev'

celery_app = Celery('meiduo')


# 给celery主程序导入配置
celery_app.config_from_object('celery_tasks.config')

# 自动注册celery任务
celery_app.autodiscover_tasks(['celery_tasks.sms', 'celery_tasks.send_email'])